/*
 * Display_7.c
 *
 * Created: 11/13/2012 1:51:23 PM
 *  Author: Hp-Minion
 */ 
/*****************************************************************************************/
#include <avr/io.h>
#include "General.h"
#include "Port.h"
#include "Display_7.h"
/*****************************************************************************************/
void Display7_vInit(void)
{
	PinMode(DP,'D',OUTPUT);		/*	DOT-pin 5 of segment*/
	PinMode(A,'D',OUTPUT);			/*	A-pin 7	of segment*/
	PinMode(B,'D',OUTPUT);			/*	B-pin 6	of segment*/
	PinMode(C,'D',OUTPUT);			/*	C-pin 4	of segment*/
	PinMode(D,'D',OUTPUT);			/*	D-pin 2	of segment*/
	PinMode(E,'D',OUTPUT);			/*	E-pin 1 of segment*/
	PinMode(F,'D',OUTPUT);			/*	F-pin 9	of segment*/
	PinMode(G,'D',OUTPUT);			/*	G-pin 10 of segment*/
		
}
/*****************************************************************************************/
void Display7_vDisplayNumber(unsigned int Value)
{
	switch (Value)
	{
		case 10: {
					DigitalWrite(DP,HIGH);
					DigitalWrite(A,LOW);
					DigitalWrite(B,LOW);
					DigitalWrite(C,LOW);
					DigitalWrite(D,LOW);
					DigitalWrite(E,LOW);
					DigitalWrite(F,LOW);
					DigitalWrite(G,LOW);
				}
		break;
		
		case 1:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,LOW);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,LOW);
					DigitalWrite(E,LOW);
					DigitalWrite(F,LOW);
					DigitalWrite(G,LOW);
				}
		break;
		
		case 2:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,LOW);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,HIGH);
					DigitalWrite(F,LOW);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 3:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,LOW);
					DigitalWrite(F,LOW);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 4:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,LOW);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,LOW);
					DigitalWrite(E,LOW);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 5:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,LOW);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,LOW);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 6:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,LOW);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,HIGH);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 7:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,LOW);
					DigitalWrite(E,LOW);
					DigitalWrite(F,LOW);
					DigitalWrite(G,LOW);
				}
		break;
		
		case 8:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,HIGH);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 9:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,LOW);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,HIGH);
				}
		break;
		
		case 0:	{
					DigitalWrite(DP,LOW);
					DigitalWrite(A,HIGH);
					DigitalWrite(B,HIGH);
					DigitalWrite(C,HIGH);
					DigitalWrite(D,HIGH);
					DigitalWrite(E,HIGH);
					DigitalWrite(F,HIGH);
					DigitalWrite(G,LOW);
				}				
		break;
		
		default:
		break;
	}	
}
/*****************************************************************************************/
